import { ActivityForm, ActivitySearch, OrderTour, TourForm, TourSearch } from "@/types/touractivity";
import { request } from "umi";
// 获取探险列表
export async function getTourList(params: TourSearch) {
  return request('/api/detail/list', {
    method: 'GET',
    params
  });
}
//获取活动列表
export async function getActivityList(params: ActivitySearch) {
  return request('/api/activity/list', {
    method: 'GET',
    params
  });
}
// 获取探险详细信息
export async function getTourDetail(params: { id: number }) {
  return request('/api/detail', {
    method: 'GET',
    params
  });
}
// 获取活动详细信息
export async function getActivityDetail(params: { id: number }) {
  return request('/api/activity', {
    method: 'GET',
    params
  });
}
// 新增探险
export async function addTour(data: TourForm) {
  return request('/auth/detail', {
    method: 'POST',
    data
  });
}
// 新增活动
export async function addActivity(data: ActivityForm) {
  return request('/auth/activity', {
    method: 'POST',
    data
  });
}
// 预定冒险
export async function orderTour(data: OrderTour) {
  return request('/auth/order', {
    method: 'POST',
    data
  });
}
// 新增愿望单
export async function wishTour(data: { advId: number }) {
  return request('/auth/wish', {
    method: 'POST',
    data
  });
}
// 查询预定探险订单列表
export async function getOrderList(params: { pageNum: number, pageSize: number, userId: number }) {
  return request('/auth/order/list', {
    method: 'GET',
    params
  });
}
// 查询愿望单列表
export async function getWishList(params: { pageNum: number, pageSize: number, userId: number }) {
  return request('/auth/wish/list', {
    method: 'GET',
    params
  });
}